//
//  ViewController.swift
//  Here_Swift
//
//  Created by 童煊 on 2017/12/25.
//  Copyright © 2017年 童煊. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    var confirmBtn = UIButton.init(type: UIButtonType.custom)
    
    convenience init(){
        self.init()
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        self.initView()
    }
    
    func initView() -> Void {
        self.view.backgroundColor = UIColor.white
        
        confirmBtn.setTitle("RAC按钮", for: UIControlState.normal)
        confirmBtn.setTitleColor(UIColor.black, for: UIControlState.normal)
        confirmBtn.frame = CGRect.init(x: 100, y: 100, width: 100, height: 100)
        self.view.addSubview(confirmBtn)
        confirmBtn.reactive.controlEvents(UIControlEvents.touchUpInside).observeValues { (touch) in
            print("点击按钮")
        }
        confirmBtn.snp.makeConstraints { (make) in
            make.center.equalTo(self.view)
            make.width.height.equalTo(100)
        }

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

